from bs4 import BeautifulSoup

doc_html = "<html><body><p>contentone</p><b>contenttwo</b></body></html>"
soup = BeautifulSoup(doc_html, "lxml")
print(soup.p)
print(soup.html.body.b)